package fnord.network.calculator;

import fnord.illuminati.action.AttackModifierAction;
import fnord.illuminati.card.*;
import fnord.illuminati.order.AttackOrder;

public class AttackCalculator extends Calculator {
	
	private int _attackPower;
	private AttackOrder _ao;
	
	
	public AttackCalculator(IlluminatiCard ic, GroupCard attacker, GroupCard defender, AttackOrder ao) {
		//TODO: calculate the power, plus any ability helpers...doesn't do much as of yet
		_attackPower = attacker.getPower();
		_ao = ao;
		traverse(ic);
	}
	
	@Override
	public void calculate(GroupCard toCalculateOn) {
		// TODO add any bonuses from this card to the attack value
		Object action = toCalculateOn.getAction();
		if(action instanceof AttackModifierAction) {
			_attackPower += ((AttackModifierAction) action).doAttack(_ao);
		}
	}
	
	public int getAttackPower() { return _attackPower; }

}
